const getters = {
	statusBarHeight:state=>state.system.statusBarHeight,
		titleBarHeight:state=>state.system.titleBarHeight,
		bodyBarHeight:state=>{
			if(state.system.foldState) return state.system.titleBarHeight;
			return 100;
		},
		totalHeight:state=>{
			if(state.system.foldState){
				return state.system.statusBarHeight+state.system.titleBarHeight+10
			}
			return state.system.statusBarHeight+state.system.titleBarHeight+100+10
		},
	foldState:state=>state.system.foldState,
	carsList:state=>state.cars.carsList,
	totalPrice:state=>{
		return state.cars.carsList.reduce((prev,next)=>{
			return prev + (Number(next.price) * Number(next.numvalue));
		},0)
	},
	disPrice:state=>{
		let price = state.cars.carsList.reduce((prev,next)=>{
			return prev + (Number(next.price) * Number(next.numvalue));
		},0)
		let before = state.cars.carsList.reduce((prev,next)=>{
			
			if (next.before_price && Number(next.before_price) > Number(next.price)){
				return prev + (Number(next.before_price) * Number(next.numvalue));
			}
			return prev;
		},0)
		
		return before - price
	},
	buynum:state=>{
		return state.cars.carsList.reduce((prev,next)=>{
			return prev+=next.numvalue
		},0)
	},
	brandData:state=>{
		return state.brand.brandData
	},
	detailPopupState:state =>state.goods.detailPopupState,
	detailData:state =>state.goods.detailData,
	proSpecsState:state =>state.goods.proSpecsState
}


export default getters;